import request from '@/utils/http'

// 查询全部数据
export function fetchList(query) {
  return request({
    url: '/codepartment',
    method: 'get',
    params: query
  })
}

// 模糊查询
export function querySome(query) {
  return request({
    url: `/codepartment/querySome`,
    method: 'get',
    params: query
  })
}

// 根据id查询
export function fetchDepartment(id) {
  return request({
    url: `/codepartment/${id}`,
    method: 'get'
  })
}


// 新增
export function createDepartment(data) {
  return request({
    url: '/codepartment',
    method: 'post',
    data
  })
}

// 更新
export function updateDepartment(data) {
  return request({
    url: '/codepartment',
    method: 'put',
    data
  })
}

// 根据ID删除
export function deleteDepartment(id) {
  return request({
    url: `/codepartment/${id}`,
    method: 'delete'
  })
}
